package com.summer.log.web;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {

    @GetMapping("{logname}")
    public String getLogname(@PathVariable("logname") String logname) {
        log.info("这是使用log4j2打印的日志：{}-{}", logname, LocalDate.now());
        return logname;
    }

}
